# coding:utf-8

# 起始index:结束index:步长 注意前包后不包
l = list(range(10))
print(l)
print(l[0:3])
print(l[0:6:2])
print(l[::])
print(l[::3])
print(l[:3:])
print(l[1::2])
print(l[::-1])
print(l[:100:])
print(l[100::])

# 切片修改
print(l)
# l[10:] = [10]
# 在尾部追加元素
l[len(l):] = [10]
print(l)
# 替换前3个元素
l[:3] = ['李昊哲', '大漂亮', '小可爱']
print(l)

# 切片删除
l[:3] = []
print(l)
# 删除偶数位置上的元素
del l[::2]
print(l)

#  del 变量删除
slogan = '桃李不言下自成蹊'
print(slogan)
del slogan
# NameError: name 'slogan' is not defined
# print(slogan)
